package com.itheima.service.impl;

import com.itheima.dao.SetmealDao;
import com.itheima.pojo.Setmeal;
import com.itheima.service.SetmealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class SetmealServiceImpl implements SetmealService {

    @Autowired
    private SetmealDao setmealDao;


    /**
     * 获取所有套餐信息
     * @return
     */
    public List<Setmeal> list() {
        List<Setmeal> setmealList = setmealDao.selectall( );
        return setmealList;
    }

    /**
     * 根据id查询套餐详情
     * @param id
     * @return
     */
    public Setmeal findById(Integer id) {
        Setmeal  setmeal = setmealDao.findById(id);
        return setmeal;
    }


}
